﻿using BCCommon.Enums;
using BCCommon.PaymentEnums;
using BCDto.Common.Payment.Payment;
using BCDto.Common.Payment.PaymentRecord;
using BCDto.Sim.Admin.Admin;
using BCDto.Website.User;
using System.Collections.Generic;

namespace BCService.Common.Payment.Payment
{
    /// <summary>
    /// 支付。
    /// </summary>
    public interface IPaymentService
    {
        /// <summary>
        /// 获取支付渠道列表
        /// </summary>
        /// <param name="appType">应用类型</param>
        /// <param name="orderType">支付订单类型</param>
        /// <param name="osType">系统类型</param>
        /// <param name="userDto"></param>
        /// <returns></returns>
        IEnumerable<ChannelDto> GetChannels(SourceAppType appType, FlowType orderType, SourceOSType osType, UserDto userDto);


        /// <summary>
        /// 获取代理商支付渠道列表
        /// </summary>
        /// <param name="appType">应用类型</param>
        /// <param name="orderType">支付订单类型</param>
        /// <param name="osType">系统类型</param>
        /// <param name="agentRecordId"></param>
        /// <returns></returns>
        IEnumerable<ChannelDto> GetAgentChannels(SourceAppType appType, FlowType orderType, SourceOSType osType, long agentRecordId);

        /// <summary>
        /// 获取提现渠道列表
        /// </summary>
        /// <param name="appType">应用类型</param>
        /// <param name="orderType">支付订单类型</param>
        /// <param name="osType">系统类型</param>
        /// <returns></returns>
        IEnumerable<ChannelDto> GetTransferChannels(SourceAppType appType, FlowType orderType, SourceOSType osType);


        /// <summary>
        /// 获取支付渠道接口
        /// </summary>
        /// <param name="appType">应用类型</param>
        /// <param name="channelType">支付渠道类型</param>
        /// <param name="osType">系统类型</param>
        /// <returns></returns>
        IChannelFactoryService GetChannelService(SourceAppType appType, PaymentChannelType channelType, SourceOSType osType);

        /// <summary>
        /// 支付成功后与原始业务同步。
        /// </summary>
        /// <param name="userDto">用户信息 (支付回调无法通过 IApplicationContextService 获取用户信息，需要传入。)</param>
        /// <param name="paymentRecordDto">支付记录。</param>
        void Synchronize(UserDto userDto, PaymentRecordDto paymentRecordDto);

        /// <summary>
        /// 代理商支付成功后与原始业务同步
        /// </summary>
        /// <param name="admin"></param>
        /// <param name="paymentRecordDto"></param>
        void AgentSynchronize(AdminDto admin, PaymentRecordDto paymentRecordDto);
    }
}
